@using BlazorApp.Pages.Common
@using BlazorApp.Pages.Common.Html.HTable
@using BlazorApp.Pages.Common.Metadata
@using BlazorApp.Pages.Event
@inherits BlazorApp.Pages.Common.DrawerPageBase<k8s.Models.V1NetworkPolicy>
@if (NetworkPolicy != null)
{
    <NetworkPolicyAction Item="NetworkPolicy" MenuMode="MenuMode.Horizontal"></NetworkPolicyAction>
    <Divider Orientation="left" Style="font-weight:bold">@L["Metadata"]</Divider>
    <MetadataView Item="NetworkPolicy.Metadata" ExplainFieldPrefix="networkPolicy"></MetadataView>
    <Divider Orientation="left" Style="font-weight:bold">@L["Spec"]</Divider>
    <HTable Bordered Column="1">
        <PropertyListView Title=@L["PolicyTypes"] Items="@NetworkPolicy.Spec.PolicyTypes"
                          ExplainField="networkPolicy.spec.policyTypes" T="string">
        </PropertyListView>
        <LabelSelectorView Title=@L["PodSelector"] LabelSelector="@NetworkPolicy.Spec.PodSelector" NullDesc="All Pod"
                           ExplainField="networkPolicy.spec.podSelector">
        </LabelSelectorView>

        <NetworkPolicyIngressView Ingress="@NetworkPolicy.Spec.Ingress" Title=@L["Ingress"]></NetworkPolicyIngressView>
        <NetworkPolicyEgressView Egress="@NetworkPolicy.Spec.Egress" Title=@L["Egress"]></NetworkPolicyEgressView>
    </HTable>
    <MiniEventListView Uid="@NetworkPolicy.Metadata.Uid"></MiniEventListView>
}
